/**
*      author: Y_Yao
*      created: 2024-12-13 19:42:14
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 5 + 1;
int a[N][N];
int n,m,T;
int sx,sy,fx,fy;
int ans = 0;
bool vis[N][N];
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
void dfs(int x,int y)
{
    if(x == fx && y == fy)
    {
        ans++;
        return;
    }

    for(int i = 0;i < 4;i++)
    {
        int ta = x + dx[i],tb = y + dy[i];
        if(ta < 1 || ta > n || tb < 1 || tb > m || vis[ta][tb] || a[ta][tb]) continue;
        vis[ta][tb] = true;
        dfs(ta,tb);
        vis[ta][tb] = false;
    }
}

void solve()
{
    cin >> n >> m >> T;
    cin >> sx >> sy >> fx >> fy;
    while(T--)
    {
        int x,y;
        cin >> x >> y;
        a[x][y] = 1;
    }

    vis[sx][sy] = true;
    dfs(sx,sy);
    cout << ans << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}